package modele.articles;

import java.util.List;
import java.util.Vector;

/*
 * Classe representant un mot
 */

public class Mot extends Element
{
	//la probabilite de trouver le mot a sa position actuelle
	private float probabilite;
	//liste de mots suggeres en remplacement s'il n'est pas correct
	private List<String> suggestions = null;
	
	public Mot(String valeur, Element eltPrecedent, Element eltSuivant)
	{
		super(valeur, eltPrecedent, eltSuivant);
		this.probabilite = 0;
		
		suggestions = new Vector<String>();
		suggestions.add("Test1");
		suggestions.add("Test2");
		suggestions.add("Test3");
	}
	
	public List<String> getSuggestions()
	{
		return this.suggestions;
	}
	
	public void setSuggestions(List<String> vSugg)
	{
		this.suggestions = vSugg;
	}
	
	@Override
	public String getTypeElement()
	{
		return Element.TYPE_MOT;
	}

	public void setProbabilite(float probabilite)
	{
		this.probabilite = probabilite;
		Article.getInstance().updateHighlight(offsetDebut, offsetDebut + taille, probabilite);
	}

	public float getProbabilite()
	{
		return probabilite;
	}
	
	@Override
	public String toString()
	{
		return String.valueOf(offsetDebut) + " : " + valeur + " -> " + String.valueOf(probabilite);
	}
}